package com.bw.controller.order;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.bw.entity.order.PiOrderItem;
import com.bw.entity.order.PiOrderItemProcess;
import com.bw.resp.ResponseResult;
import com.bw.service.order.IPiOrderItemProcessService;
import com.bw.service.order.IPiOrderItemService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *  订单零件工序
 * @author yzz
 * @since 2020-06-20
 */
@RestController
@RequestMapping("/MaterPro")
public class PiOrderItemProcessController {
    @Autowired
    private IPiOrderItemProcessService iPiOrderItemProcessService;

    private final Logger logger= LoggerFactory.getLogger(PiOrderItemProcessController.class);

//    /**
//     * 根据工序id查询对应的零件工序集合
//     * @param id
//     * @return
//     */
//    @PostMapping("getByProId/{id}")
//    public ResponseResult getByProId(@PathVariable("id") Long id ){
//        logger.info("订单零件工序查询开始");
//        ResponseResult re=new ResponseResult(false,400,"查询失败");
//        try {
//            QueryWrapper qw = new QueryWrapper();
//            if (id != null) {//对比传入ID和工序id相同的工序
//                qw.eq("processId",id);
//            }
//            List<PiOrderItemProcess> list = iPiOrderItemProcessService.list(qw);
//            re.setResult(list);
//            re.setCode(200);
//            re.setMessage("查询成功");
//            re.setSuccess(true);
//            logger.info("订单零件工序查询结束");
//            return  re;
//        } catch (Exception e) {
//            logger.error("订单零件工序查询错误,{}"+e.toString());
//            return  re;
//        }
//    }
}
